/*
 * @Description: 
 * @version: 
 * @Author: hui.wang01
 * @Date: 2020-08-16 12:57:36
 * @LastEditors: hui.wang01
 */
import Vue from 'vue'
import VueRouter from '../vueRouter/hashMode.js'
// import VueRouter from '../vueRouter/index.js'
// import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
/*1.注册路由插件 Vue.use接收的参数如果是函数，Vue.use内部会直接调用这个函数来注册插件；
而如果是对象的话，会调用这个对象的install方法；
*/
Vue.use(VueRouter)

// 2.创建router对象
const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path: '*',
    name: '404',
    component: () => import(/* webpackChunkName: "404" */ '../views/404.vue')
  }
]

const router = new VueRouter({
  mode: 'hash',
  routes
})

export default router 
